package com.goblin.model.uaa.service;

import java.util.List;

import com.goblin.common.response.PageHelper;
import com.goblin.common.response.Paged;
import com.goblin.model.uaa.po.Menu;
import com.goblin.model.uaa.po.Priv;
import com.goblin.model.uaa.po.User;
import com.goblin.model.uaa.repository.PrivRepository;
import com.goblin.model.uaa.repository.UserRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class PrivServiceImpl implements PrivService {
	@Autowired
	private PrivRepository privRepository;

	@Override
	public Paged<Priv> paged(PageHelper pageable) {
		return this.privRepository.paged(pageable);

	}

	@Override
	public List<Priv> tree() {

		List<Priv> entities = this.privRepository.findPrivsByIsRoot(true);

		return entities;

	}

	@Override
	public List<Priv> all() {
		return this.privRepository.findAll();
	}

}
